#include "kdeadmouseutils_plugin.h"
#include "shellinvoker.h"
#include "simpledbus.h"
#include "dbusservice.h"
#include <QtDeclarative/qdeclarative.h>
#include <QDBusInterface>
#include <QtDBus>
#include <QDBusInterface>
#include <QDeclarativeEngine>
#include <QDeclarativeContext>
#include "qmlsetting.h"
#include "vlcplayer.h"

void KDeadMouseUtilsPlugin::registerTypes(const char *uri)
{
    qDebug()<< "register objects" ;
    qmlRegisterType<ShellInvoker>(uri, 1, 0, "ShellInvoker");
    qmlRegisterType<QmlSetting>(uri, 1, 0, "QmlSetting");
    qmlRegisterType<VlcPlayer>(uri, 1, 0, "VlcPlayer");

    qmlRegisterInterface<QDeclarativeEngine>("QDeclarativeEngine");
    qmlRegisterInterface<QDBusInterface>("QDBusInterface");
    qmlRegisterType<DbusService>(uri, 1, 0, "DbusService");
    //qmlRegisterInterface<QDBusInterface>("QDBusInterface");
    qDebug()<< "register objects OK" ;
}

void KDeadMouseUtilsPlugin::initializeEngine ( QDeclarativeEngine * engine, const char * uri ){
   qDebug()<< "init engine" ;
   SimpleDbus * s = new SimpleDbus(engine);
   engine->rootContext()->setContextProperty("dBusServer", s);
   qDebug()<< "init engine OK" ;
}

Q_EXPORT_PLUGIN2(KDeadMouseUtils, KDeadMouseUtilsPlugin)

